package com.zhang.common.jpa.rep;


import com.zhang.common.jpa.entity.BaseEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.NoRepositoryBean;

import java.util.List;
import java.util.Optional;
import java.util.Set;

@NoRepositoryBean
public interface BaseRep<T extends BaseEntity, ID> extends JpaRepository<T,ID>, JpaSpecificationExecutor<T> {


    Optional<T> findByIdAndDeleted(ID id, boolean deleted);


    Set<T> findByIdInAndDeleted(Set<ID> ids, boolean deleted);


    List<T> findByDeleted(boolean deleted);


}
